Chris Pollett > Old Classes >
CS185c

( Print View )

Student Corner:
  [Grades Sec5]

  [Submit Sec5]

  [Class Sign Up Sec5]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [HW/Quiz Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HWs and Quizzes:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Quizzes]  [Project]

Practice Exams:
  [Mid]  [Final]

                           












HW#4 --- last modified February 10 2019 21:54:22..

Solution set.

Due date: May 2

Files to be submitted:
  Hw4.zip

Purpose: To experiment with the graphics capabilities of your phone. To experiment with the accelerometer and location based facilities.

Related Course Outcomes:

The main course outcomes covered by this assignment are:

LO1 -- Create a working mobile phone application and test it both in a simulator and on a mobile device.

LO2 -- Write a mobile application that involves GUI components and makes use of touch events to manipulate these components.

LO4 -- Write a mobile application that uses either the camera, location, or device graphics API.

Specification:

As you know, technology can be unreliable. Therefore, it is always handy to have a sundial hanging around. As when I was growing up I never had my own pocket sundial, for this homework, I want you to create a such an app for your mobile device. This app should make use of your devices compass to figure out which way is north, it should use the time of day to guess where the sun is, GPS to figure out how high it is in the sky for that time of day, and the accelerometer to figure out the orientation/tilt of your phone. Your app should then draw a clock face (this should not be a bitmap, but actually drawn using 2d or 3d graphics). The face does not need to have numbers on it. At the center of the face we imagine there is a pole sticking up out of your phone. You should then draw the appropriate shadow this pole casts. Tilting the phone should dynamically change this shadow according to your phone tilt. The mathematics for all this may be a little tricky so I will give 1 bonus point for working that all out. I will give full credit if you draw the dial, and you have a "shadow" that gives the current time (hour) based on north being 12 o'clock, and where the length of shadow varies with the tilt of the phone (getting shorter if the phone is not held flat). This project will be tested on a device. To ensure you are getting GPS and and accelerometer info, if I make a right finger swipe on your screen a text display of this info should appear. If I then "double-tap" it should go away.

For this project there is no separate 286 variant.

Point Breakdown

Coding style is decent. No dead code; No funky indentation; Decently documented.1
When launched app draws a sundial with pole using 2d or 3d graphics no bitmaps2pts
Shadow direction is either according to accurate math, or varies as described above and the north direction.2pts
Shadow length varies with tilt1pts
Finger swipe brings up text info2pts
Double tap makes text info go away2pts
Total10pts